package xyz.lilei123.demo.index.constants;

import cn.hutool.extra.spring.SpringUtil;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import xyz.lilei123.demo.index.IBuildService;
import xyz.lilei123.demo.service.IPositionService;
import xyz.lilei123.demo.service.impl.PositionServiceImpl;

import javax.annotation.Resource;

/**
 * @author jack
 * @version 1.0
 * @date 25/01/2022 16:17
 **/
public enum  IndexEnum {
    /**
     * 索引枚举
     */
    POSITION("position", "职位",(s, e)->
        SpringUtil.getBean(IPositionService.class).build(s,e)
    ),
    ;


    private final String indexName;
    private final String indexDesc;
    private final IBuildService buildService;

    IndexEnum(String indexName, String indexDesc,IBuildService buildService ) {
        this.indexName = indexName;
        this.indexDesc = indexDesc;
        this.buildService = buildService;
    }

    public String getIndexName() {
        return indexName;
    }

    public String getIndexDesc() {
        return indexDesc;
    }

    public IBuildService getBuildService() {
        return buildService;
    }


}
